import request from '@/utils/request'
export function getProjectList(data) {
  return request({
    url: '/project/getList',
    method: 'post',
    data
  })
}
export function addProject(data) {
  return request({
    url: '/project/add',
    method: 'post',
    data
  })
}
export function initProject(data) {
  return request({
    url: '/project/init',
    method: 'post',
    data
  })
}
export function updateProject(data) {
  return request({
    url: '/project/update',
    method: 'post',
    data
  })
}
export function deleteProject(data) {
  return request({
    url: '/project/delete',
    method: 'post',
    data
  })
}
// 批量删除
export function deleteBatchProject(data) {
  return request({
    url: '/project/deleteBatch',
    method: 'post',
    data
  })
}
// 获取项目配置信息
export function exportProject(data) {
  return request({
    url: '/project/exportDriverFile',
    responseType: 'blob',
    method: 'post',
    data
  })
}
// 保存配置
export function saveConfig(data) {
  return request({
    url: '/project/saveConfig',
    method: 'post',
    data
  })
}
// 初始化配置
export function initConfig(data) {
  return request({
    url: '/project/initConfig',
    method: 'post',
    data
  })
}
// 解析芯片Json文件
export function parseJsonFile(data) {
  return request({
    url: '/chip/parseJsonFile',
    method: 'post',
    data
  })
}
// 获取芯片列表
export function getChipList(data) {
  return request({
    url: '/chip/getChipList',
    method: 'post'
  })
}

// 芯片库分页查询
export function getChipData(data) {
  return request({
    url: '/chip/loadGrid',
    method: 'post',
    data
  })
}
// 芯片库-添加芯片
export function addChipByFile(data) {
  return request({
    url: '/chip/addChipByFile',
    method: 'post',
    data
  })
}
// 芯片详情
export function getChipDetail(data) {
  return request({
    url: '/chip/getChipInfo',
    method: 'post',
    data
  })
}
// 芯片库-更新芯片定义文件
export function updateChipByFile(data) {
  return request({
    url: '/chip/updateChipByFile',
    method: 'post',
    data
  })
}
// 芯片库-编辑信息信息
export function updateChip(data) {
  return request({
    url: '/chip/update',
    method: 'post',
    data
  })
}
// 芯片库-删除
export function deleteChip(data) {
  return request({
    url: '/chip/delete',
    method: 'post',
    data
  })
}
// 电路生成模块芯片列表导入
export function importChipModuleTargetFromExcelIncrement(data) {
  return request({
    url: '/circuitGenerationModuleChip/importChipModuleTargetFromExcelIncrement',
    method: 'post',
    data
  })
}
// 电路生成模块芯片列表导入
export function importChipModuleTargetFromExcelAll(data) {
  return request({
    url: '/circuitGenerationModuleChip/importChipModuleTargetFromExcelAll',
    method: 'post',
    data
  })
}
// 电路生成模块芯片列表导出
export function exportCircuitGenerationModuleChip() {
  return request({
    url: '/circuitGenerationModuleChip/exportExcel',
    responseType: 'blob', // 设置响应类型为 blob
    method: 'post'
  })
}
// 下载文件
export function downloadFiles(data) {
  return request({
    url: '/files/download',
    method: 'post',
    data
  })
}
// 芯片库-获取类别列表
export function loadChipCategoryList(data) {
  return request({
    url: '/chip/loadChipCategoryList',
    method: 'post',
    data
  })
}
// 获取被控芯片控制模式下拉框列表
export function getChipControlModeList(data) {
  return request({
    url: '/chipControlMode/getOptionList',
    method: 'post',
    data
  })
}
// 获取芯片控制模式接口列表
export function getChipControlModeInterfaceList(data) {
  return request({
    url: '/chipControlModeInterface/getList',
    method: 'post',
    data
  })
}
// 获取主控芯片接口引脚和参数数据
export function getPinAndParameterData(data) {
  return request({
    url: '/chipInterface/getPinAndParameterData',
    method: 'post',
    data
  })
}
// 获取引脚编号下拉框数据
export function getPinCodeOptionData(data) {
  return request({
    url: '/chipInterface/getPinCodeOptionData',
    method: 'post',
    data
  })
}
// 获取引脚芯片参数列表
export function getPinParameter(data) {
  return request({
    url: '/chipPinParameter/getList',
    method: 'post',
    data
  })
}

/** 驱动程序库 start */
// 主页分页列表
export function getDriverLibraryData(data) {
  return request({
    url: '/driverLibrary/loadGrid',
    method: 'post',
    data
  })
}
// 添加驱动库页面-获取下拉芯片
export function loadTreeByCategory(data) {
  return request({
    url: '/driverLibrary/loadTreeByCategory',
    method: 'post',
    data
  })
}
// 添加驱动库
export function addDriverLibrary(data) {
  return request({
    url: '/driverLibrary/add',
    method: 'post',
    data
  })
}
// 通过文件修改被控驱动信息
export function updateDriverLibraryByFile(data) {
  return request({
    url: '/driverLibrary/updateByFile',
    method: 'post',
    data
  })
}
export function adaptiveDriverLibrary(data) {
  return request({
    url: '/driverLibrary/adaptiveDriverLibrary',
    method: 'post',
    data
  })
}
// 添加.h或.c 文件
export function addDriverFile(data) {
  return request({
    url: '/driverLibrary/addDriverFile',
    method: 'post',
    data
  })
}
// 编辑文件名称
export function editFileName(data) {
  return request({
    url: '/files/editName',
    method: 'post',
    data
  })
}
// 删除文件
export function deleteFile(data) {
  return request({
    url: '/files/delete',
    method: 'post',
    data
  })
}
// 删除驱动库
export function deleteDriverLibrary(data) {
  return request({
    url: '/driverLibrary/delete',
    method: 'post',
    data
  })
}
// 加载工程目录树
export function loadDriverLibraryDirectoryTree(data) {
  return request({
    url: '/driverLibraryDirectory/loadTree',
    method: 'post',
    data
  })
}
// 获取单个被控驱动信息
export function getOneSlaveDriverInfo(data) {
  return request({
    url: '/driverLibrary/getOneSlaveDriverInfo',
    method: 'post',
    data
  })
}
// 加载工程配置文件
export function loadDriverLibraryConfig(data) {
  return request({
    url: '/driverLibraryConfig/loadConfig',
    method: 'post',
    data
  })
}
// 添加配置文件
export function addDriverLibraryConfig(data) {
  return request({
    url: '/driverLibraryConfig/add',
    method: 'post',
    data
  })
}
// 删除配置文件
export function deleteDriverLibraryConfig(data) {
  return request({
    url: '/driverLibraryConfig/delete',
    method: 'post',
    data
  })
}
// 工程目录-编辑
export function editDirectoryName(data) {
  return request({
    url: '/driverLibraryDirectory/editDirectoryName',
    method: 'post',
    data
  })
}
// 工程目录-删除
export function deleteDriverLibraryDirectory(data) {
  return request({
    url: '/driverLibraryDirectory/delete',
    method: 'post',
    data
  })
}
// 工程目录-下载
export function downloadDriverLibraryDirectory(data) {
  return request({
    url: '/driverLibraryDirectory/download',
    responseType: 'blob',
    method: 'post',
    data
  })
}
// 工程目录-上传文件
export function uploadFileDriverLibraryDirectory(data) {
  return request({
    url: '/driverLibraryDirectory/uploadFile',
    method: 'post',
    data
  })
}
// 工程目录-上传文件夹
export function uploadFolderDriverLibraryDirectory(data) {
  return request({
    url: '/driverLibraryDirectory/uploadFolder',
    method: 'post',
    data
  })
}
// 工程目录-添加子文件夹
export function addFolderDriverLibraryDirectory(data) {
  return request({
    url: '/driverLibraryDirectory/addFolder',
    method: 'post',
    data
  })
}
/** 驱动程序库 end */
